//
//  HomeViewController.swift
//  XMGTV-ls
//
//  Created by 梁森 on 2020/4/27.
//  Copyright © 2020 LS. All rights reserved.
//

import UIKit

class HomeViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

}


extension HomeViewController{
    override func setupUI() {
        super.setupUI()
        setNavigatoinBar()
    }
    private func setNavigatoinBar(){
        navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named: "home-logo"), style: .plain, target: nil, action: nil)
        navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "search_btn_follow"), style: .plain, target: self, action: #selector(rightItemClick))
        let searchBar = UISearchBar(frame: CGRect(x: 0, y: 0, width: 200, height: 30))
        searchBar.placeholder = "主播昵称/房间名/链接"
        searchBar.searchBarStyle = .minimal
        // iOS13不能再访问此私有变量
//        let searchBarField = searchBar.value(forKey: "_searchField") as? UITextField
//        searchBarField?.textColor = UIColor.white
        searchBar.searchTextField.textColor = UIColor.white
        navigationItem.titleView = searchBar
    }
    
    @objc private func rightItemClick(){
        
    }
}
